<html>
<head>
<script src="triangulate.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
function submitCoords() {

  var data = [{
    "latitude":parseFloat(document.forms["coordForm"]["latitude1"].value),
    "longitude":parseFloat(document.forms["coordForm"]["longitude1"].value)
    },
    { "latitude":parseFloat(document.forms["coordForm"]["latitude2"].value),
    "longitude":parseFloat(document.forms["coordForm"]["longitude2"].value)
    },
    { "latitude":parseFloat(document.forms["coordForm"]["latitude3"].value),
    "longitude":parseFloat(document.forms["coordForm"]["longitude3"].value)
  }];

  var location = triangulate(data);

  document.getElementById("result").innerHTML="Latitude: " + location.latitude + "<br>Longitude: " + location.longitude;

  return false;
}
</script>

</head>

<body>
<form name="coordForm">
Latitude 1: <input type="text" name="latitude1">
Longitude 1: <input type="text" name="longitude1">
<br>
Latitude 2: <input type="text" name="latitude2">
Longitude 2: <input type="text" name="longitude2">
<br>
Latitude 3: <input type="text" name="latitude3">
Longitude 3: <input type="text" name="longitude3">
<br>
<input type="button" value="Submit" onclick="submitCoords();">
</form>
<br>
<div id="result"></div>
</body>
</html>